package hust.hiepdv.javaproject.model;

import java.awt.Image;
import java.awt.Rectangle;

public class DrawableObject {
	protected int x;
	protected int y;
	protected int width;
	protected int height;
	protected Image image;
	
	public DrawableObject(){
		this.x = 0;
		this.y = 0;
		this.image = null;
	}
	
	public DrawableObject(int x, int y, Image image){
		this.x = x;
		this.y = y;
		this.image = image;
	}
	
	public DrawableObject(int x, int y, int width, int height){
		this.x = x;
		this.y = y;
		this.width = width;
		this.height = height;
	}
	
	/**
	 * Return a new rectangle that encompasses the drawable object
	 * @return Rectangle
	 */
	public Rectangle getBounds(){
		return new Rectangle(x, y, width, height);
	}
	
	public int getX() {
		return x;
	}
	public void setX(int x) {
		this.x = x;
	}
	public int getY() {
		return y;
	}
	public void setY(int y) {
		this.y = y;
	}
	public Image getImage() {
		return image;
	}
	public void setImage(Image image) {
		this.image = image;
	}

	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}		
}
